#{if _mode == 'display' }
	<table id="formations_table">
		<thead>
			<tr>
				<th></th>
				<th>Titre</th>
				<th>Etablissement</th>
				<th>Date Début</th>
				<th>Date Fin</th>
			</tr>
		</thead>
		<tbody>
			#{list items:_collaborator.getValidProfile().getFormations(), as:'formation' }
			<tr>
				<td>
					<img src="http://datatables.net/examples/examples_support/details_open.png" alt="expand" 
					onclick="expandFormation(this, ${formation.getFormationID()});"/>
					#{if _canEdit == true}
						<img src="http://www.bloggingbistro.com/wp-content/uploads/2011/03/Delete-Icon.png" width="20px" alt="expand" 
						onclick="deleteFormation(${formation.getFormationID()}, '${formation.getTitle().escapeJavaScript().escapeHtml()}');"/>
						<img src="http://cdn1.iconfinder.com/data/icons/icojoy/shadow/standart/png/24x24/001_45.png" width="20px" alt="expand" 
							onclick="showUpdateFormationPanel(${formation.getFormationID()});"/>
					#{/if}
				</td>
				<td>${formation.getTitle()}</td>
				<td>${formation.getEstablishment().raw()}</td>
				<td>${_tools.getDateAsString(formation.getStartDate())}</td>
				<td>${_tools.getDateAsString(formation.getEndDate())}</td>
			</tr>
			#{/list}
		</tbody>
	</table>
#{/if}

#{if _mode == 'display_pdf' }
	<table id="formations_table_pdf">
		<thead>
			<tr>
				<th>Titre</th>
				<th>Etablissement</th>
				<th>Année</th>
			</tr>
		</thead>
		<tbody>
			#{list items:_collaborator.getValidProfile().getFormations(), as:'formation' }
			<tr style='font-size: 10pt;'>
				<td>${formation.getTitle()}</td>
				<td>${formation.getEstablishment().raw()}</td>
				<td>${formation.getEndDate().format("yyyy")}</td>
			<br/>
			</tr>
			#{/list}
		</tbody>
	</table>
#{/if}

#{if _mode == 'add'}
	#{form @Collaborator.addFormation(_collaborator.getCollaboratorID()), method:'POST', id:'addFormationForm', enctype:'multipart/form-data' }
		#{field 'formationTitle'}
	      	<label>Titre</label>
	        <input type="text" size="50" id="${field.id}" name="${field.name}" />
		#{/field}		
		<br/>
		
		#{field 'formationStartDate'}
	      	<label>Date début</label>
	        <input type="text" size="10" id="${field.id}" name="${field.name}" />
		#{/field}
		<br/>
		
		#{field 'formationEndDate'}
	      	<label>Date fin</label>
	        <input type="text" size="10" id="${field.id}" name="${field.name}" />
		#{/field}	
		<br/>
		
		#{field 'formationEstablishment'}
	      	<label for="${field.name}">Etablissement</label>
	        <textarea rows="5" id="${field.id}" name="${field.name}" cols="50" rows="15"></textarea>
		#{/field}	
		<br/>
		
		<label for="formation_skills_panel">Competences</label>
		<img src="@{'/public/images/plus.jpg'}" alt="plus" width="25px" onclick="javascript:addFormationSkillInput()"/>
		<img src="@{'/public/images/minus.jpg'}" alt="minus" width="25px" onclick="javascript:removeFormationSkillInput()"/>
		
		<div id="formation_skills_panel">
			<input type="hidden" name="formationSkillsList" id="formationSkillsList" value=""/>		
		</div>
		<br/>
	#{/form}
	<button id="add_formation_button" onclick="javascript:submitFormationForm()">Ajouter Formation</button>
#{/if}

#{if _mode == 'edit'}
	#{form @Collaborator.updateFormation(), method:'POST', id:'updateFormationForm', enctype:'multipart/form-data' }
		<input type="hidden" id="updateFormationID" name="updateFormationID"/>
		#{field 'updateFormationTitle'}
	      	<label>Titre</label>
	        <input type="text" size="50" id="${field.id}" name="${field.name}" />
		#{/field}		
		<br/>
		
		#{field 'updateFormationStartDate'}
	      	<label>Date début</label>
	        <input type="text" size="10" id="${field.id}" name="${field.name}" />
		#{/field}
		<br/>
		
		#{field 'updateFormationEndDate'}
	      	<label>Date fin</label>
	        <input type="text" size="10" id="${field.id}" name="${field.name}" />
		#{/field}	
		<br/>
		
		#{field 'updateFormationEstablishment'}
	      	<label for="${field.name}">Etablissement</label>
	        <input type="text" id="${field.id}" name="${field.name}"/>
		#{/field}	
		<br/>
		
		<label for="update_formation_skills_panel">Competences</label>
		<img src="@{'/public/images/plus.jpg'}" alt="plus" width="25px" onclick="javascript:addUpdateFormationSkillInput()"/>
		<img src="@{'/public/images/minus.jpg'}" alt="minus" width="25px" onclick="javascript:removeUpdateFormationSkillInput()"/>
		
		<div id="update_formation_skills_panel">
			<input type="hidden" name="updateFormationSkillsList" id="updateFormationSkillsList" value=""/>		
		</div>
		<br/>
	#{/form}
	<button id="update_formation_button" onclick="javascript:updateFormation()">Modifier Formation</button>
#{/if}

